<!DOCTYPE html>
<html>
<head>
<include file="Include:meta" />
<title>全部物资流水-目的地运营集团数据管理平台</title>
<include file="Include:style" />
<style>
	.folder span{ display: inline-block; margin: 0 40px 0 1px; }
	.w280{ width: 280px; }
</style>
</head>
<body>
<include file="Include:header" />
<include file="Include:left" />
<div id="main">
	<div class="crumbs">
		<div class="crumbs-text">物资库 > 全部物资流水</div>
	</div>
	<div id="content">
		<div class="filter clearfix">
			<div class="filter-item w280 left" style="border: none">
				<div class="filter-title">流水类型</div>
				<ul class="filter-order">
					<li <if condition="$types eq -10">class="current"</if>>
						<a href="__APP__/Administration/material_change_all/types/-10/syb/{$syb}/start/{$start}/end/{$end}/gid/{$gid}">全部</a>
					</li>
					<li <if condition="$types eq 1">class="current"</if>>
						<a href="__APP__/Administration/material_change_all/types/1/syb/{$syb}/start/{$start}/end/{$end}/gid/{$gid}">入库</a>
					</li>
					<li <if condition="$types eq 2">class="current"</if>>
						<a href="__APP__/Administration/material_change_all/types/2/syb/{$syb}/start/{$start}/end/{$end}/gid/{$gid}">出库</a>
					</li>
				</ul>
			</div>
			<div class="filter-item w280 left" style="border: none">
				<div class="filter-title">事业部</div>
				<ul class="filter-order">
					<li <if condition="$syb eq -10">class="current"</if>>
						<a href="__APP__/Administration/material_change_all/types/{$types}/syb/-10/start/{$start}/end/{$end}/gid/{$gid}">全部</a>
					</li>
					<li <if condition="$syb eq 目的地">class="current"</if>>
						<a href="__APP__/Administration/material_change_all/types/{$types}/syb/目的地/start/{$start}/end/{$end}/gid/{$gid}">目的地</a>
					</li>
					<li <if condition="$syb eq 旅发">class="current"</if>>
						<a href="__APP__/Administration/material_change_all/types/{$types}/syb/旅发/start/{$start}/end/{$end}/gid/{$gid}">旅发</a>
					</li>
					<li <if condition="$syb eq 旅投">class="current"</if>>
						<a href="__APP__/Administration/material_change_all/types/{$types}/syb/旅投/start/{$start}/end/{$end}/gid/{$gid}">旅投</a>
					</li>
					<li <if condition="$syb eq 景翼">class="current"</if>>
						<a href="__APP__/Administration/material_change_all/types/{$types}/syb/景翼/start/{$start}/end/{$end}/gid/{$gid}">景翼</a>
					</li>
				</ul>
			</div>
			<div class="filter-item w280 left" style="border: none">
				<div class="filter-title">日期筛选：</div>
				<div>
					<input name="start" value="{$start}" type="text" class="form-control Wdate required-text w100" onclick="WdatePicker()" readonly autocomplete="off">
					-
					<input name="end" value="{$end}" type="text" class="form-control Wdate required-text w100" onclick="WdatePicker()" readonly autocomplete="off">
					<span class='error-item'>开始日期必须小于结束日期</span>
					<button class="btn btndate" type="button">搜索</button>
				</div>
			</div>
		</div>
		<div class="table-scrollx">
			<table class="table table-bordered table-hover">
				<tr class="table-header fixed-table-header">
					<td width="300">
						<select name="gid" class="w200">
							<option value="-10" <if condition="$gid eq -10">selected</if>>物品编号[名称]</option>
							<foreach name="goods" item="u">
							<option value="{$u['id']}" <if condition="$u['id'] eq $gid">selected</if>>{$u['number']}[{$u['name']}]</option>
							</foreach>
						</select>
					</td>
					<td width="">事业部</td>
					<td width="">流水类型</td>
					<td width="">数量</td>
					<td width="">单价(元)</td>
					<td width="">金额(元)</td>
					<td width="">操作人(日期)</td>
					<td width="">领用人</td>
					<td width="">用途</td>
				</tr>
				<if condition="$result eq NULL">
				<tr><td class="Text_c" colspan="9">暂无相关数据</td></tr>
				</if>
				<foreach name="result" item="vo">
					<tr>
						<td>{$vo['number']}[{$vo['name']}]</td>
						<td>{$vo['business_unit']}</td>
						<td><if condition="$vo['types'] eq 1"><span class="blue">入库(来源:{$vo['manufacturer']})</span><else/><span class="red">出库</span></if></td>
						<td>{$vo['nums']}</td>
						<td>{$vo['prices']+0}</td>
						<td>{$vo['sum']+0}</td>
						<td>{$vo['add_user']}({$vo['add_date']|substr=0,10})</td>
						<td>{$vo['user_name']}</td>
						<td>{$vo['purpose']}</td>
					</tr>
				</foreach>
			</table>
		</div>
		<div class="pages">{$page}</div>
	</div>
</div>
<include file="Include:javascript" />
<script type="text/javascript">
$(function(){
	//日期筛选
	$(".btndate").click(function(){
		var start = $("[name=start]").val(),
			end = $("[name=end]").val();
		if(Date.parse(end)>=Date.parse(start)){
			window.location.href = "__APP__/Administration/material_change_all/types/{$types}/syb/{$syb}/start/"+start+"/end/"+end+"/gid/{$gid}";
		}else{
			$(this).nextAll(".error-item").show();
		}
	});
	//取消错误提示
	$(".Wdate").on("focus",function(){
		$(this).nextAll(".error-item").hide();
	});
	$(document).on("change","[name='gid']",function(){
		var val = $(this).val();
		window.location.href="__APP__/Administration/material_change_all/types/{$types}/syb/{$syb}/gid/"+val+"/start/{$start}/end/{$end}";
	});
});
</script>
</body>
</html>